#include<bits/stdc++.h>

using namespace std;
int n,l;
double a[20],b[20],minn=1000000000;
//int dp[20][100000];
bool hasvis[20];
double dis(int x,int y){
    return sqrt((a[x]-a[y])*(a[x]-a[y])+(b[x]-b[y])*(b[x]-b[y]));
}
void dfs(int k,double d,int cur){
    l++;
    if(l>30000000){
        int t=clock();
        if(t>=950){
           printf("%.2lf",minn);
           exit(0);
        }
    }
    if(d>minn)return;
    if(k==n){
        minn = min(d,minn);
        return;
    }
    for(int i=1;i<=n;i++){
        if(!hasvis[i]){
//            int t = bit+(1<<(i-1));
//            if(dp[i][t]!=0&&dp[i][t]<=d+dis(i,cur))continue;
            hasvis[i]=1;
//            dp[i][t]=d+dis(i,cur);
            dfs(k+1,d+dis(i,cur),i);
            hasvis[i]=0;
        }
    }
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i];
    }
    dfs(0,0,0);
    printf("%.2lf",minn);
}
